<?php

    /**
     * This file is part of the Intelligencer package.
     * For the full copyright and license, please view the LICENSE
     * file that was distributed with this source code.
     * 
     * @author      drapeko <roman.drapeko@gmail.com>
     * @copyright   Roman Drapeko <roman.drapeko@gmail.com>, 2009 - present
     */

    /**
     * This is a wrapper to save primitive values (integer, string etc) in persistent cache
     * @author drapeko
     */
    class itPersistentCacheablePrimitive implements itPersistentCacheableI {
        
        protected $val;
        
        /**
         * Wrapper for primitive values
         * @param $val
         */
        public function __construct($val) {
            $this->val = $val;
        }
        
        /**
         * (non-PHPdoc)
         * @see Intelligencer/LibUtil/Cache/itPersistentCacheableI#toPersistentCache()
         */
        public function toPersistentCache() {
            return $this->val;
        }
        
        /**
         * (non-PHPdoc)
         * @see Intelligencer/LibUtil/Cache/itPersistentCacheableI#fromPersistentCache($val)
         */
        public function fromPersistentCache($val) {
            $this->val = $val;
        }
        
        /**
         * Returns the pure value
         * @return string 
         */
        public function getValue() {
            return $this->val;
        }
    }
    
    
?>